package com.ww.java.generic.method;

import java.util.EnumSet;
import java.util.Set;

import static com.ww.java.generic.method.Sets.*;
import static com.ww.java.generic.method.Watercolors.*;

/**
 * @author wanggw
 * @Date 2023年01月02 16:16
 */
public class WatercolorSets {
    public static void main(String[] args) {
        Set<Watercolors> set1 = EnumSet.range(BRILLIANT_RED, VIRIDIAN_HUE);
        Set<Watercolors> set2 = EnumSet.range(CERULEAN_BLUE_HUE, BURNT_UMBER);
        System.out.println("集合1：" + set1);
        System.out.println("集合2：" + set2);
        System.out.println("并集：" + union(set1, set2));
        // 交集
        Set<Watercolors> subSet = intersection(set1, set2);
        System.out.println("交集：" + subSet);
        System.out.println("差集：" + difference(set1, subSet));
        System.out.println("差集：" + difference(set2, subSet));
        System.out.println("complement：" + complement(set1, set2));
    }
}
